/*
* Copyright (c)  2017, ueboot.com
* All rights reserved.
* 2017-11-05 18:13:22
*/
package com.ueboot.weishop.repository.goods;

import com.ueboot.weishop.entity.goods.GoodsSalesSpecEntity;
import com.ueboot.core.repository.BaseRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by yangkui  on 2017-11-05 18:13:22.
 *
 * @author yangkui
 * @since 2.0 by autocode
 */
@Repository
public interface GoodsSalesSpecRepository extends BaseRepository<GoodsSalesSpecEntity, Long> {

    List<GoodsSalesSpecEntity> findBySpecValueFullPathValue(String specValueFullPathValue);

    List<GoodsSalesSpecEntity> findBySpecValueFullPathValueAndName(String specValueFullPathValue, String name);

    /**
     * 根据商品ID，删除所有商品的价格数据
     * @param goodsInfoId 商品ID
     */
    void deleteGoodsSalesSpecEntitiesByGoodsInfoId(Long goodsInfoId);

    List<GoodsSalesSpecEntity> findBySpecValueFullPathValueAndGoodsInfoId(String specValueFullPathValue, Long goodsInfoId);
    GoodsSalesSpecEntity findById(Long id);
}
